package cn.harry.cabinet.api.enums

/**
 * 外部接口服务类型枚举
 */
enum class ExternalServiceType(val serviceName: String, val description: String) {

    /**
     * 新增用户
     */
    ADD_USER("AddUser", "新增用户"),

    /**
     * 修改用户
     */
    UPDATE_USER("UpdateUser", "修改用户"),

    /**
     * 删除用户
     */
    DELETE_USER("DeleteUser", "删除用户"),

    /**
     * 人脸识别记录
     */
    FACE_RECOGNITION_RECORD("FaceRecognitionRecord", "人脸识别记录"),

    /**
     * 刷卡记录
     */
    CARD_SWIPE_RECORD("CardSwipeRecord", "刷卡记录"),

    /**
     * 取物记录
     */
    TAKE_ITEM_RECORD("TakeItemRecord", "取物记录"),

    /**
     * 还物记录
     */
    RETURN_ITEM_RECORD("ReturnItemRecord", "还物记录");

    companion object {
        /**
         * 根据服务名称获取枚举
         */
        fun fromServiceName(serviceName: String): ExternalServiceType? {
            return ExternalServiceType.entries.find { it.serviceName == serviceName }
        }
    }
}